import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:stroke_text/stroke_text.dart';
import 'package:vdrag_saas/Utils.dart';
import 'package:vdrag_saas/detail/use_product.dart';
import 'package:vdrag_saas/model/product.dart';

class AppBarBox extends StatelessWidget {
  const AppBarBox({super.key});

  @override
  Widget build(BuildContext context) {
    bool isMobile = Utils.isMobile(context);
    double screenWidth = MediaQuery.of(context).size.width;
    if (isMobile) {
      return Column(
        children: [
          Padding(
            padding: const EdgeInsetsDirectional.symmetric(horizontal: 12),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                Image.asset('assets/images/logo.png', width: 82, height: 30),
                UseProduct(Product(), label: "立即咨询", showQR: true),
              ],
            ),
          ),
          Row(
            children: [
              Expanded(
                child: Container(
                  height: 96,
                  decoration: const BoxDecoration(
                      image: DecorationImage(
                          fit: BoxFit.cover,
                          image: AssetImage('assets/images/banner.png'))),
                  child: const Column(
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: [
                      StrokeText(
                        text: '致力于成为国内领先的',
                        textStyle: TextStyle(
                            color: Color(0xff333333),
                            fontFamily: '优设标题黑',
                            fontSize: 25),
                        strokeColor: Colors.white,
                        strokeWidth: 1,
                      ),
                      StrokeText(
                        text: '企业能源行业数字孪生服务商',
                        textStyle: TextStyle(
                          fontFamily: '优设标题黑',
                          fontSize: 25,
                          color: Color(0xff1070ff)
                        ),
                        strokeColor: Colors.white,
                        strokeWidth: 1,
                      )
                    ],
                  ),
                ),
              ),
            ],
          ),
        ],
      );
    } else {
      return Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          // Image.asset('assets/images/logo.png', width: 125, height: 45),
          Row(
            children: [
              Expanded(
                child: Container(
                  padding: const EdgeInsetsDirectional.only(top: 104),
                  height: 310,
                  decoration: const BoxDecoration(
                      image: DecorationImage(
                          fit: BoxFit.cover,
                          image: AssetImage('assets/images/app-bar-bg.png'))),
                  child: const Row(
                    mainAxisAlignment: MainAxisAlignment.center,
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      StrokeText(
                        text: '致力于成为国内领先的',
                        textStyle: TextStyle(
                            color: Color(0xff333333),
                            fontFamily: '优设标题黑',
                            fontSize: 46),
                        strokeColor: Colors.white,
                        strokeWidth: 1,
                      ),
                      StrokeText(
                        text: '企业能源行业数字孪生服务商',
                        textStyle: TextStyle(
                            fontFamily: '优设标题黑',
                            fontSize: 46,
                            color: Color(0xff1170ff)),
                        strokeColor: Colors.white,
                        strokeWidth: 1,
                      )
                    ],
                  ),
                ),
              ),
            ],
          ),
        ],
      );
    }
  }
}
